//-
//- 
//-
package com.ntf.games.framework.impl.gl;

import javax.media.opengl.awt.GLCanvas;

import com.ntf.games.framework.Screen;
import com.ntf.games.framework.ScreenManager;

////////////
//- @author Me
//-
//- 
//-
public class GLScreenManager extends ScreenManager
{
  // ////////////////////
  // -
  public GLCanvas _canvas;

  // ////////////////////
  // -
  public GLScreenManager( GLCanvas glcanvas)
  {
    super();
    this._canvas = glcanvas;

  }

  // ////////////////////
  // ////////////////////
  // -
  public void insertScreen( int _index, Screen _screen)
  {
    super.insertScreen( _index, _screen);
    this._canvas.addGLEventListener( _index, (GLScreen )_screen);
  }

  // ////////////////////
  // -
  public void addScreen( Screen _screen)
  {
    super.addScreen( _screen);
    this._canvas.addGLEventListener( (GLScreen )_screen);
  }

  // ////////////////////
  // -
  public GLScreen removeScreen( int index)
  {
    GLScreen screen = (GLScreen )(super.removeScreen( index));
    this._canvas.removeGLEventListener( screen);
    return(screen);
  }

  // ////////////////////
  // -
  public Screen removeScreen( Screen _screen)
  {
    GLScreen screen = (GLScreen )(super.removeScreen( _screen));
    this._canvas.removeGLEventListener( screen);
    return(screen);
  }
}